/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package controller;

import java.util.List;
import javax.ejb.EJB;
import javax.ejb.Stateful;
import model.dto.PersonDTO;
import model.DAO.Logic;
import model.dto.ApplicationDTO;
import model.integration.Application;


/**
 *
 * @author Ahmed Salem
 */
@Stateful
public class Facade {
    @EJB
    private Logic l;
    
   
    /**
     *
     * @return A list of applicationDTO to get all the applications 
     */
    public List<ApplicationDTO> getApplicationsFacade(){
        return l.getMyApplication();
    }
    
    /**
     *
     * @param ap 
     * creates an application
     */
    public void createApplicationFacade(Application ap)
    {
        System.out.println("Facade");
        l.createApplication(ap);
    }

    /**
     *
     * @param user
     * @param password
     * @return An object of personDTO if the user exist
     */ 
    public PersonDTO logInFacade(String user, String password){
        return l.getAdmin(user,password);
        
    }

}
